import { createSlice, PayloadAction } from "@reduxjs/toolkit";

export interface AuthState {
  chatId: string | null;
}

const initialState: AuthState = {
  chatId: null,
};

const authSlice = createSlice({
  name: "chatId",
  initialState,
  reducers: {
    setChatId: (state, action: PayloadAction<string>) => {
      state.chatId = action.payload;
    },
  },
});
export const { setChatId } = authSlice.actions;
export default authSlice.reducer;
